Repository navigation
fs: add node:fs/synchronous - #67771
Open
LiviaMedeiros wants to merge 1 commit into
Open
LiviaMedeiros wants to merge 1 commit into
LiviaMedeiros wants to merge 1 commit into
Conversation
Signed-off-by: LiviaMedeiros <livia@cirno.name>
Collaborator
|
Review requested:
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #67771 +/- ##
==========================================
+ Coverage 90.53% 90.56% +0.02%
==========================================
Files 803 805 +2
Lines 285202 285525 +323
Branches 55070 55085 +15
==========================================
+ Hits 258195 258573 +378
+ Misses 17147 17101 -46
+ Partials 9860 9851 -9
🚀 New features to boost your workflow:
|
Contributor
|
Adding
semver-major
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR was born out of curiosity if this is feasible without breaking everything and affecting performance. It adds
node:fs/synchronousexport, similar tonode:fs/promisesbut for Synchronous API methods, strippingSyncsuffixes from them.lib/fs.jsis the second biggest (only topped bylib/internal/quic/quic.js) file inlibin terms of line count, mainly because it implements both Callback API and Synchronous API. This basically splits it in two halves, making each implementation scoped in own file, and aggregates sync methods on dedicated object.From userland perspective, it's a sugar for scripts that deliberately prefer only sync methods.
Benchmark CI: https://ci.nodejs.org/view/Node.js%20benchmark/job/benchmark-node-micro-benchmarks/1909/